<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <!-- 利用splice修改 -->
    <!-- splice(index,howmany，value) index,从那个下标开始  howmany 删除多少个  value,插入的值，可以插入多个-->
    <script>
        var a=[1,2,3,4,5];
        var arr2 = ["a","b"];
        a.splice(3,1,1,2,3);//将1,2,3传入数组
        a.splice(3,1,arr2);//将arr2传入数组
        console.log(...a);
    </script>
</body>
</html>